<?php

class Ogloszenie extends BaseOgloszenie
{
     public function __toString()
  {
    return sprintf('%s at %s (%s)', $this->getTytul(), $this->getCreatedAt());
  }
  public function getTytulSlug()
{
  return Extra::slugify($this->getTytul());
}

public function save(PropelPDO $con = null)
  {
    if ($this->isNew() && !$this->getExpiresAt())
    {
      $now = $this->getCreatedAt() ? $this->getCreatedAt('U') : time();
      $this->setExpiresAt($now + 86400 * 30);
    }

    return parent::save($con);
  }
}
